{include file="common/_header"}

<body>

<div class="x-body layui-anim layui-anim-up">
    <form class="layui-form">
        <input type="hidden" name="express_id" value="{$type.express_id}">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">快递名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="express_name" autocomplete="off" placeholder="请按照文件填写正确的快递名称" class="layui-input" lay-verify="required"
                           value="{$type.express_name}">
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">快递编码</label>
                <div class="layui-input-inline">
                    <input type="text" name="express_code" autocomplete="off" placeholder="请填写正确的快递编码" class="layui-input" value="{$type.express_code}">
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-inline">
                    <select name="status">
                        <option value="1" {if $type.status== 1}selected{/if}>正常</option>
                        <option value="2" {if $type.status== 2}selected{/if}>下架</option>
                    </select>
                </div>
            </div>
        </div>

        <div style="margin-top: 50px; float: right; margin-right: 50px;">
            <button type="button" lay-submit lay-filter="add" class="layui-btn">立即提交</button>
        </div>
    </form>
</div>
</body>


<script>

    layui.use(['form', 'layer', 'layedit', 'upload'], function () {

        var form = layui.form;

        form.on('submit(add)', function (data) {

            // data.field.detail = layui.layedit.getContent(index);

            $.ajax({
                'url': '/express/boxexpress',
                'type': 'post',
                'data': data.field,
                'dataType': 'json',
                success: function (data) {
                    if (data.code == 1) {
                        layer.msg(data.msg, {
                            icon: 6,
                            time: 800,
                        }, function () {
                            window.parent.location.href = data.url;
                        })
                    } else if (data.code == 0) {
                        layer.msg(data.msg);
                    }
                }
            });
        });

    });


</script>

{include file="common/_bottom"}